import Map
import MyGA
import Draw

# 设置参数
level = 20000                          # 关卡过关分数
index = eval("Map.index" + str(level)) # 关卡指针位置
pNum = len(index)                      # 指针的数量，即指针标号的上界
clickNum = 15                          # 玩家点击次数
size_pop = 2000                         # 种群数量
max_iter = 200                         # 最大迭代次数
pc = 0.6                               # 交叉率
prob_mut = 0.02                        # 基因的变异率

history_king, history_fitV = MyGA.run(level, size_pop, clickNum, pNum, max_iter, pc, prob_mut)
Draw.showData(history_king, history_fitV, level, clickNum, size_pop, max_iter, pc, prob_mut)
